package pers.xuyong.code.overload;

/**
 * 悟透重载,静态分派
 *
 * @author billymac
 * @version 1.0
 * @date 17/10/11  上午10:07
 * @since JDK1.8
 */
public class Overload {

    static class Human {}

    static class Man extends Human {}

    static class Women extends Human {}

    public void sayHello(Human human) {
        System.out.println("Hello, Human!");
    }

    public void sayHello(Man man) {
        System.out.println("Hello, Man!");
    }

    public void sayHello(Women women) {
        System.out.println("Hello, Women!");
    }


    public static void main(String[] args) {
        {
            byte[] bytes = new byte[64*1024*1024];
        }
        int a = 0;
        System.gc();
//        Human man = new Man();
//        Human women = new Women();
//        Overload overload = new Overload();
//        overload.sayHello(man);
//        overload.sayHello(women);
    }
}
